<?
//判断是会否管理员，如果是用户的话，只能看到属于该用户部门的资料
//客户要求，所有部门能查看所有学生。
//if(($_SESSION['mid']!="admin")&&($_SESSION['mid']!="finance"))
//{
//    $condition="and departmentid = '".$_SESSION['departmentid']."'";
//}


//接收传递过来的分类id
$applydate  = addslashes($_REQUEST ['applydate']);

 

//分类id存在，则说明要搜索板块中某一个分类的产品。
if ($applydate)
{
    $condition="and applydate like '%".$applydate."%'";
}

//设置需要搜索的表格的前缀后缀
    $table_suffix = $plate['table_suffix'];
    $table = $table_Prefix . $table_suffix;
    echo $sqlstr="SELECT COUNT(nid) FROM $table where (sid is null or sid = '0') $condition";
    $query = mysql_query($sqlstr);
    $sum = mysql_result($query, 0);

?>









 
<?
//设置需要搜索的表格的排序项和升降项
$sort_by = "nid";
$sort_order = "desc";
//设置需要搜索的表格的排序项和升降项


if ($_REQUEST ['sortby']) {
    $sort_by = $_REQUEST ['sortby'];
}


if ($_REQUEST ['sortorder']) {
    $sort_order = $_REQUEST ['sortorder'];
}




echo $sqlstr="select * from $table where (sid is null or sid = '0')  $condition ORDER BY $sort_by $sort_order  limit $detailstar , $detailnum";
	$result = mysql_query($sqlstr);


while ($row = mysql_fetch_array($result)) {
    $detail[]           = $row;
}

mysql_close($con);

?>








